<{include file="section/admin/header2.tpl"}>
<script type="text/javascript" src="<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/highslide-with-html.js"></script>
<link rel="stylesheet" type="text/css" href="<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/highslide.css" />
<script type="text/javascript">
hs.graphicsDir = '<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
</script>

<div class="box02">
	<div class="box02_1">
		<div class="search02 clear">
			<form action="/shoplog/" method="get" name="frm" id="frm">
				<table cellpadding="0" cellspacing="0" width="100%" border="0" >
					<tr>
						<td>
							<div class="select">
								<span style="width:100px;">
									<select name="query" id="query" onchange="change_query(this.value);">
										<option <{if $current_query=='all'}>selected<{/if}> value="all">全部</option>
										<option <{if $current_query=='unauthorized'}>selected<{/if}> value="unauthorized">未认证</option>
										<option <{if $current_query=='anthorized'}>selected<{/if}> value="anthorized">已认证</option>
										<option <{if $current_query=='delete'}>selected<{/if}> value="delete">已删除</option>
									</select>
								</span>
							</div>
						</td>
						<td width="60%">
							<div clase="sort">
								<input type="radio" name="sort" id="sort_1" width="100px" <{if $current_sort neq '2'}>checked<{/if}> 
										value="1" onclick="sort_click(this.value);">按时间排序</input>
								<input type="radio" name="sort" id="sort_2" width="100px" <{if $current_sort eq '2'}>checked<{/if}>
										 value="2" onclick="sort_click(this.value);">按店铺名称排序</input>
							</div>
						</td>
						<td align="right">
							<div class="find">
								<input type="text" name="search" id="search" width="100px" value="<{$current_search}>">
								<input type="submit" class="btn04" value="搜　索" >
							</div>
						</td>
					</tr>
				</table>
			</form>
		</div>        
		<div class="line1"></div>
		<div class="table01">
			<table cellpadding="0" cellspacing="0" width="100%" border="0" id="table" style="word-wrap:break-word;table-layout:fixed;overflow:hidden;text-overflow:ellipsis;">
				<tr class="th">
					<th width="120px" ><div>店铺资料类别</div></th>
					<th><div>修改前信息</div></th>
					<th><div>修改后信息</div></th>
					<th width="200px"><div>店铺名称</div></th>
					<th width="120px"><div>修改时间</div></th>
					<th><div>操作</div></th>		
				</tr>
				<{foreach from=$logs item=log }>
				
					<tr class="bg">
						<td align="center"><div><{$log.shopinfo_type}>&nbsp;</div></td>
						<td width="120px"><div>
						<{if $log.is_image}>
							<a href="<{$log.log_img_old_url}>" target="_blank"><img width="120" title="查看原图" height="100" border="0" src="<{$log.log_img_old_url}>"  ></a>
						<{else}>
							<{$log.log_str_old}>&nbsp;
						<{/if}>
						</div></td>
						<td width="120px"><div>
						<{if $log.is_image}>
							<a href="<{$log.log_img_new_url}>" target="_blank"><img width="120" title="查看原图" height="100" border="0" src="<{$log.log_img_new_url}>" ></a>
							
						<{else}>
							<{$log.log_str_new}>&nbsp;
						<{/if}>
						</div></td>
						<td  align="center"><div><a href="<{$log.shop_url}>" target="_blank"><{$log.shop_name}></a>&nbsp;</div></td>
						<td ><div><{'Y-m-d H:i:s'|@date:$log.created}>&nbsp;</div></td>
						<td width="60px"><div>
							<{if $log.k_status eq "normal"}>
								<a href="" onclick="return hs.htmlExpand(this)">删除</a>
								<div class="highslide-maincontent">
									<form id="reason_frm_<{$exposure.id}>"  name="reason_frm_<{$exposure.id}>" method="post">
										<table cellpadding="0" cellspacing="0" width="100%" border="0"  style="word-wrap:break-word;table-layout:fixed;overflow:hidden;text-overflow:ellipsis;">
										<tr><td style="width:80px;">店铺名称：</td><td align="left"><{$log.shop_name}></td></tr>
										<tr><td style="width:80px;"><span class="red">*</span>处理原因：</td>
										<td align="left"><select name="reason_<{$log.id}>" id="reason_<{$log.id}>" >
											<{foreach from=$delete_reasons item=reason}>
												<option  value="<{$reason.flag}>"><{$reason.name}></option>
											<{/foreach}>
										</select></td>
										<tr ><td colspan="2" align="center"><input type="button" name="onsubmit" value="提交" onclick="confirm_delete('<{$log.id}>','<{$log.status}>','<{$current_sort}>')"/></td></tr>
										</table>							
									</form>
								</div> 
							<{elseif $log.k_status eq "unauthorized"}>
								<a href="/shoplog/authorize/<{$log.id}>/<{$log.status}>?query=<{$current_query}>&search=<{$current_search}>&sort=<{$current_sort}>">认证</a> |				
								<a href="" onclick="return hs.htmlExpand(this)">删除</a>
								<div class="highslide-maincontent">
									<form id="reason_frm_<{$log.id}>"  name="reason_frm_<{$log.id}>" method="post">
										<table cellpadding="0" cellspacing="0" width="100%" border="0"  style="word-wrap:break-word;table-layout:fixed;overflow:hidden;text-overflow:ellipsis;">
										<tr><td style="width:80px;">店铺名称：</td><td align="left"><{$log.shop_name}></td></tr>
										<tr><td style="width:80px;"><span class="red">*</span>处理原因：</td>
										<td align="left"><select name="reason_<{$log.id}>" id="reason_<{$log.id}>" >
											<{foreach from=$delete_reasons item=reason}>
												<option  value="<{$reason.flag}>"><{$reason.name}></option>
											<{/foreach}>
										</select></td>
										<tr ><td colspan="2" align="center"><input type="button" name="onsubmit" value="提交" onclick="confirm_delete('<{$log.id}>','<{$log.status}>','<{$current_sort}>')"/></td></tr>
										</table>							
									</form>
								</div> 
							<{elseif $log.k_status eq "anthorized"}>
								<a href="/shoplog/unauthorize/<{$log.id}>/<{$log.status}>?query=<{$current_query}>&search=<{$current_search}>&sort=<{$current_sort}>">取消认证</a> |				
								<a href="" onclick="return hs.htmlExpand(this)">删除</a>
								<div class="highslide-maincontent">
									<form id="reason_frm_<{$log.id}>"  name="reason_frm_<{$log.id}>" method="post">
										<table cellpadding="0" cellspacing="0" width="100%" border="0"  style="word-wrap:break-word;table-layout:fixed;overflow:hidden;text-overflow:ellipsis;">
										<tr><td style="width:80px;">店铺名称：</td><td align="left"><{$log.shop_name}></td></tr>
										<tr><td style="width:80px;"><span class="red">*</span>处理原因：</td>
										<td align="left"><select name="reason_<{$log.id}>" id="reason_<{$log.id}>" >
											<{foreach from=$delete_reasons item=reason}>
												<option  value="<{$reason.flag}>"><{$reason.name}></option>
											<{/foreach}>
										</select></td>
										<tr ><td colspan="2" align="center"><input type="button" name="onsubmit" value="提交" onclick="confirm_delete('<{$log.id}>','<{$log.status}>','<{$current_sort}>')"/></td></tr>
										</table>							
									</form>
								</div> 
							<{elseif $log.k_status eq "delete"}>
								<a href="/shoplog/recover/<{$log.id}>/<{$log.status}>?query=<{$current_query}>&search=<{$current_search}>&sort=<{$current_sort}>">恢复</a>
							<{/if}>&nbsp;
						</div></td>
					</tr> 
				<{/foreach}>
				
			</table>
		</div>
		<div class="page clear">
		<{if $pre_page gt 0}>
		<a href="/shoplog/?query=<{$current_query}>&search=<{$current_search}>&sort=<{$current_sort}>&page=<{$pre_page}>">上一页</a> 
		<{else}>
		上一页
		<{/if}>
		<{if $next_page gt 0}>
		<a href="/shoplog/?query=<{$current_query}>&search=<{$current_search}>&sort=<{$current_sort}>&page=<{$next_page}>">下一页</a> 
		<{else}>
		下一页
		<{/if}>
		</div>
	
	</div>	
</div>
<script type="text/javascript">

function change_query(query)
{
   var url = "/shoplog?query="+query;
   window.location = url;
}

function sort_click(sort_value)
{
	var query=document.getElementById('query');
	var search=document.getElementById('search');
	if(!query) return false;
	if(!query) return false;	
	var url = "/shoplog?query="+query.value+"&search="+search.value+"&sort="+sort_value;
	window.location = url;
	
}
function confirm_delete(log_id,status,sort)
{
	var reason = document.getElementById("reason_" + log_id);	
	var query = document.getElementById("query");		
	var search = document.getElementById("search");		

    if( ! reason) return false;
    if( ! query) return false;
    if( ! search) return false;
    if( ! sort) sort='1';

    
	var reason_value	= reason.value;
	if(!reason_value)
	{
		alert("处理原因不能为空！");
		return false;
	}
	var query_value	= query.value;
	var search_value	= search.value;
	var url = "/shoplog/delete/"+log_id+"/"+status+"/"+reason_value+"?query="+query_value+"&search="+search_value+"&sort="+sort;
	window.location = url;
	
}
</script>
<{include file="section/admin/footer2.tpl"}>
